<!doctype html>
<html lang="en">
<head>
	<meta charset="utf-8" />	
	<title><?=$this->admin->config['sitename']?> Administration Login</title>	
	<script type="text/javascript" src="<?=url_tmpl()?>js/jquery.js"></script>
	 <link  media="screen" rel="stylesheet" type="text/css" href="<?=url_tmpl()?>login.css" />
      <script>
  $(document).ready(function(){
  	  <?php if(isset($this->admin->login)):?>$("#submit").focus();<?php endif;?>
	$("#reload").click(function(){
			$("#loading").show();
			$(this).hide();
			//$('#captcha').contentWindow.location.reload(true);
			$("#icaptcha").attr("src","<?php echo admin_url()?>authorize/captcha<?php echo url_suffix()?>");	
			
			$("#loading").hide();
			$(this).show();
		});
	});
	</script>
</head>

<body>

<div id="box">
	<h1>
		<?=$this->admin->config['sitename']?> Administration
	</h1>
	<p>
	<a class="linkhome" href="<?php echo base_url()?>huongdan<?php echo url_suffix()?>">Hướng dẫn</a></p>
	<p>
    <span style="color:#F00;font-size:18px"><blink><?=$this->admin->config['thongbao']?></span></p>
	<p align="center">Mọi thắc mắc liên hệ:<?=$this->admin->config['lienhe']?></p>
    
    <?php 
	if($sessionValidLogin >= $this->admin->config['look_count'])
	{
		?>
<p id="error_notification">Bạn đã đăng nhập sai quá <?php echo $this->admin->config['look_count']?> lần. Bạn chỉ có thể đăng nhập lại sau <?php echo $this->admin->config['look_length'];?> phút</p>
		<?php
	}
	else
	{
	?>
	<?php
	$error = $this->admin->GetFlashData('loginerror');
	if(strlen($error)>0){
		if($error == 1)
			$texterror = lang('login_response');
		else if($error == 2)
			$texterror = lang('login_null');
		
	?>
	<p id="error_notification"><?=$texterror?></p>
	<?php }
	}
	?>
	<center>
	<form action="<?=admin_url()?>authorize/login<?=url_suffix()?>" method="post" style="width:260px; text-align:left;">
		<p>
		<label for="username"><?=lang('username')?></label><br />
		<input type="text" tabindex="1" name="user_session[login]" id="username" class="input" >
		</p>
		<p>
		<label for="password"><?=lang('password')?></label><br />
		<input type="password" tabindex="2" name="user_session[password]" id="password" class="input" >
		</p>
        <p>
		<label for="captcha"><?=lang('captcha')?></label><br />
		<input type="text" tabindex="3" name="user_session[captcha]" id="captcha" class="input captcha" ><iframe id="icaptcha" width="80px" scrolling="no" height="27px" frameborder="0" marginwidth="0px" marginheight="0px" style="border: 0px; margin:0px; padding:0px; float:left;" src="<?php echo admin_url()?>authorize/captcha<?php echo url_suffix()?>"></iframe><img id="loading" title="Đang tạo mã xác nhận mơi" align="absmiddle" src="<?=url_tmpl();?>images/spinner.gif" style="display:none; margin-left:5px; margin-top:5px;" /><img id="reload" title="Tạo mã xác nhận khác" style="cursor:pointer; margin-left:5px; margin-top:5px;" align="absmiddle" src="<?=url_tmpl();?>images/reload.gif" />
        <div style="clear:both"></div>
		</p>

		
		<input class="button" id="submit" type="submit" tabindex="4" name="submit" value="<?=lang('login')?>">
		<div class="clearfix"></div>
	</form>
	</center>
	<footer>
		<p class="author">
			©&nbsp;2011<?=(date("Y")>2011)?' - '.date("Y"):''?>&nbsp;<?=$this->admin->config['copyright']?>&nbsp;-&nbsp;Designed by Ban Ứng dụng CNTT
		</p>
	</footer>
    </div>

</body>

</html>